/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package shopping;

public class Item {
    private String itemCode;
    private String itemName;
    private int qty;
    private double price;

    public Item() {
    }

    public Item(String itemCode, String itemName, int qty, double price) {
        this.itemCode = itemCode;
        this.itemName = itemName;
        this.qty = qty;
        this.price = price;
    }

    public String getItemCode() {
        return itemCode;
    }

    public String getItemName() {
        return itemName;
    }

    public double getPrice() {
        return price;
    }

    public int getQty() {
        return qty;
    }

    public void setItemCode(String itemCode) {
        this.itemCode = itemCode;
    }

    public void setItemName(String itemName) {
        this.itemName = itemName;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public void setQty(int qty) {
        this.qty = qty;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Item other = (Item) obj;
        if ((this.itemCode == null) ? (other.itemCode != null) : !this.itemCode.equals(other.itemCode)) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 3;
        hash = 29 * hash + (this.itemCode != null ? this.itemCode.hashCode() : 0);
        return hash;
    }

}
